<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
  <head>    
    <title></title>
  </head>
  
  <body>
  <%
	 String str=request.getParameter("num");
	 if(str==null)
	 	str="0";
	 try{
		double n=Double.parseDouble(str);
		if(n<0){
			response.setContentType("text/plain;charset=gb2312");
			out.print(n+"的平方为："+n*n);
		}else if(n<100){
			response.setContentType("application/msword;charset=gb2312");
			out.print(n+"的立方为："+n*n*n);
		}else{
			response.setStatus(404);
		}	 	
	 }catch(Exception e){
	 	response.sendRedirect("input2.jsp");
	 }
  %>
  	
  </body>
</html>
